package lib.hj.com.commonlib.utils;

import com.google.gson.Gson;
import com.zhy.http.okhttp.OkHttpUtils;
import com.zhy.http.okhttp.builder.GetBuilder;
import com.zhy.http.okhttp.builder.OkHttpRequestBuilder;
import com.zhy.http.okhttp.builder.PostFormBuilder;
import com.zhy.http.okhttp.callback.StringCallback;
import com.zhy.http.okhttp.request.RequestCall;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import lib.hj.com.commonlib.bean.BaseBean;
import lib.hj.com.commonlib.manager.HttpManager;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * author:dyz
 * 网络请求业务层
 * Created by Cola on 15/10/8.
 */

public class HttpHelper {



    //不带参数
    public  static  void  getData(Class cls,OnAsyncHttpResponse asynHttp) {

        Req req = new Req();
        req.cls = cls;
        req.onAsynHttp = asynHttp;
        req.url = "http://aike.baidu.com/api/openapi/BaikeLemmaCardApi?scope=103&format=json&appid=379020&bk_key=%E9%93%B6%E9%AD%82&bk_length=600";
        HttpManager.getHttpData(req);

    }

    //带参数
    public  static  void  getData2(Class cls, Map<String,String>map,OnAsyncHttpResponse asynHttp) {

        Req req = new Req();
        req.cls = cls;
        //参数
//        req.parameter = map;
        req.onAsynHttp = asynHttp;
        req.url = "http://test.heimaoyc.com/heimao/shipperApp.shtml";
        HttpManager.getHttpData(req);

    }





}
